package br.com.vpsa.previdordevendas.model.util;

import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.List;

import com.google.gson.Gson;

public class JsonUtils {
	
	public static <T extends Serializable> List<T> getList( String jsonString, Type collectionType ){
		return new Gson().fromJson(jsonString, collectionType);
	}	
		
	public static <T extends Serializable> T getObject( String jsonString, Class<T> type ){
		return new Gson().fromJson(jsonString, type);
	}
	
	public static String getJson( Object obj ){
		return new Gson().toJson(obj);
	}
}
